<template>
  <div>
    <div class="container">
    <MusicItem v-for="item of musics" :key="item.id" :item="item"></MusicItem>
  </div>
  </div>
</template>

<script>
import MusicItem from './components/MusicItem.vue'
import axios from 'axios'
import { toRefs, reactive,onMounted } from 'vue';
export default {
   components: { MusicItem },
   setup() {
   const state = reactive({
        musics: [],
      });
      onMounted(() => {
        axios.get("http://122.112.161.135:3000/dj/program/toplist").then((res) => {
        state.musics = res.data.toplist;
        });
      });
      const refState = toRefs(state);
      return refState   
  },
}
</script>

<style>

</style>